<template>
    <div class="action">
        <el-button type="info"  @click="reload(1)" style=""><el-icon    style=""><refresh /></el-icon></el-button>
        
        <el-button type="primary" @click="add(1)" v-if="showBtns.indexOf('add') !== -1">
        新增 
        </el-button>
        <el-button type="danger"   @click="alldel(1)" v-if="showBtns.indexOf('alldel') !== -1">批量删除 </el-button>
         
        <el-button type="info"   @click="Recycle(1)" v-if="showBtns.indexOf('Recycle') !== -1">回收站 </el-button>
         
    </div> 
</template>
<script>
export default {
  name: "ActionButton",
   props:{
		show:{}
	}, 
    data() {
        return {
            showBtns:[]
        }
    },
    mounted() {
        this.getDataList();
    },
     methods:{ 
        getDataList(){
            var datavar= this.show;
            
            this.showBtns=datavar.split(","); //字符分割 
        
           
        },
        reload(){
            location.reload()
        },
            
        add(_id){
              this.$parent.add(1);
        },
        alldel(_id){
          this.$parent.alldel(1);
        
        },
        Recycle(){
             this.$parent.Recycle();
        }
    },
  
};	
</script>
 